
var sequelize = require('../util/db.js');
const Sequelize = require('sequelize');
const User = require('./user.js');

var Pet = sequelize.define('pet', {
	  name: {
	  	type:Sequelize.STRING,
	  	 unique: true 
	  },
	  type: Sequelize.BIGINT,
	  quantity: {
	  	type:Sequelize.INTEGER, 
        allowNull: false
	  },
	  userId:Sequelize.STRING(128)
	});
Pet.belongsTo(User, {foreignKey: 'userId', targetKey: 'id'});

module.exports = Pet;
